package com.example.bookservice.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 
 * </p>
 *
 * @author 软工2104-李家强-2100770248
 * @since 2023-09-20
 */
@Getter
@Setter
@TableName("chapter")
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "Chapter对象", description = "Chapter对象")
public class Chapter implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("章节id")
    @TableId("chapter_id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long chapterId;

    @ApiModelProperty("书籍id")
    @TableField("book_id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @NotNull(message = "请输入书籍id")
    private Long bookId;

    @ApiModelProperty("章节标题")
    @TableField("title")
    @NotBlank(message = "请输入章节标题")
    private String title;

    @ApiModelProperty("章节正文")
    @TableField("content")
    @NotBlank(message = "请输入章节内容")
    private String content;

    @ApiModelProperty("发布日期")
    @TableField("publication_date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime publicationDate;

    @ApiModelProperty("修改日期")
    @TableField("update_date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateDate;

    @ApiModelProperty("是否已审核")
    @TableField("is_approved")
    private Boolean isApproved;

    @ApiModelProperty("是否可用")
    @TableField("is_available")
    private Boolean isAvailable;


}
